<template>
    <component :is="component"></component>
</template>
  
<script setup>
import { computed } from 'vue';
import { useRouter } from './router';

const router = useRouter();

const component = computed(() => {
    const route = router.routes.find((route) => {
        return route.path === router.current.value;
    });
    console.log(
        route.component
    );
    return route ? route.component : null;
});
</script>
